package com.spring.batch.base.config;

import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.PropertySource;
import org.springframework.context.support.PropertySourcesPlaceholderConfigurer;
import org.springframework.scheduling.annotation.EnableScheduling;

/**
 * ClassName: SpringConfig
 * Description: Spring 基础配置
 * Date: 2017/5/8 19:40
 *
 * @author SAM SHO
 * @version V1.0
 */
@Configuration
@PropertySource(value = "classpath:jdbc.properties")
@ComponentScan(basePackages = "com.spring.batch")
@EnableScheduling
public class SpringConfig {

    /**
     * 使用@Value()需要配置这个Bean
     *
     * @return
     */
    @Bean
    public PropertySourcesPlaceholderConfigurer propertyConfigurer() {
        return new PropertySourcesPlaceholderConfigurer();
    }

}
